#include<iostream>
#include<string>
#include<string.h>
#include<vector>
#include<cstdio>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
using namespace std;
#define ll long long
#define pi acos(-1)
const int maxn = 1e6+5;
const int mod = 1e6+3;

long long c[1010][1010];
void init()   //预处理求组合数 
{
	for(int i=0;i<1010;++i)
	for(int j=0;j<=i;++j)
	{
		if(!j) c[i][j] = 1;
		else c[i][j] = (c[i-1][j]+c[i-1][j-1])%mod;
	}
}

int ans[5000];

signed main()
{
	init();
	int n;
	while(~scanf("%d",&n))
	{
		memset(ans,0,sizeof(ans));
		for(int i=1;i<=n;++i)
		{
			int x;
			scanf("%d",&x);
			
			for(int j=1;x;++j)
			{
				if(x&1) ++ans[j];
				x >>= 1;
			}
		}
		
		for(int i=1;i<=n;++i)  //异或个数
		{
			int sum = 0;
			for(int j=1;j<=32;++j)  //第j项
			{
				for(int k=1;k<=ans[j]&&k<=i;k+=2)   //取奇数个 
				{
					sum = ((((c[ans[j]][k]*c[n-ans[j]][i-k])%mod)*(1<<(j-1))%mod)%mod+sum)%mod;
				}
			}
			if(i!=n) printf("%d ",sum);
			else printf("%d\n",sum);
		}
	}
	return 0;
}
